<?php

namespace app\admin\controller;

use app\admin\service\AppraiseService;
use support\spark\model\order\OrderComment;
use support\Request;

class AppraiseController extends Curd
{
    /**
     * 评价列表
     */
    public function index()
    {
        if (request()->isAjax()) {
            $appraiseService = new AppraiseService();
            $res = $appraiseService->getList(request()->all());
            return sparkSuccess($res);
        }
        return view('appraise/index');
    }

    /**
     * 删除评价
     */
    public function del()
    {
        if (request()->isAjax()) {
            $id = request()->input('id');
            $commentModel = new OrderComment();
            $commentModel->delById($id);
            return sparkSuccess(dataReturn(0,'删除成功'));
        }
    }
}
